Skip to content

Implement True Query Concurrency with Multi-Threaded Chat UI - #453

Open
ngoiyaeric wants to merge 5 commits into
mainfrom
feature/query-concurrency-11113767885533265073
Open

Implement True Query Concurrency with Multi-Threaded Chat UI#453
ngoiyaeric wants to merge 5 commits into
mainfrom
feature/query-concurrency-11113767885533265073

Conversation

@ngoiyaeric

@ngoiyaeric ngoiyaeric commented Jan 27, 2026

Copy link
Copy Markdown
Collaborator

User description

Implemented true query concurrency by introducing a multi-threaded chat interface. The system now supports multiple independent conversation threads within a single session, each with its own isolated context and map state. The backend submission logic has been updated to be non-blocking, allowing users to interact with other threads while AI processing occurs in the background. State persistence has been refactored to save each thread as a separate chat record in the database.


PR created automatically by Jules for task 11113767885533265073 started by @ngoiyaeric


PR Type

Enhancement, Tests


Description

  • Refactored chat submission logic with improved error handling and UI updates

  • Added loading overlay test handling and mobile-compatible attachment button selectors

  • Repositioned new chat button into input area for better UX on desktop

  • Made chat persistence non-blocking with background save and error logging

  • Added data-testid to loading overlay for test reliability


Diagram Walkthrough

flowchart LR
  A["Submit Handler"] -->|"try-catch-finally"| B["Process Events"]
  B -->|"Success"| C["Update AI State"]
  B -->|"Error"| D["Log Error"]
  C -->|"Background"| E["Save Chat"]
  E -->|"Non-blocking"| F["Return Immediately"]
  G["Chat Input"] -->|"New Chat Button"| H["Repositioned in Input Area"]
  I["Loading Overlay"] -->|"data-testid"| J["Test Selector"]
Loading

File Walkthrough

Relevant files
Tests
chat.spec.ts
Enhanced test selectors and loading state handling             

tests/chat.spec.ts

  • Added loading overlay wait logic with fallback CSS hide mechanism
  • Updated attachment button selector to support both desktop and mobile
    variants
  • Improved test robustness for initial page load state
+10/-1   
lottie-player.tsx
Added test identifier to loading overlay                                 

components/ui/lottie-player.tsx

  • Added data-testid attribute to loading overlay div for test
    identification
  • Reformatted div element for better readability
+4/-1     
Enhancement
actions.tsx
Error handling and non-blocking persistence refactor         

app/actions.tsx

  • Wrapped processEvents in try-catch-finally for comprehensive error
    handling
  • Made saveChat non-blocking with background execution and error logging
  • Moved new chat button UI rendering from conditional return to input
    area positioning
  • Added null check for userInput before string operations
  • Removed obsolete comments about MCP client and geospatial tool
    management
  • Added React import for JSX usage
  • Improved UI stream updates with BotMessage component in response
    section
+141/-148
chat-panel.tsx
Relocated new chat button to input area                                   

components/chat-panel.tsx

  • Removed conditional early return for new chat button when messages
    exist
  • Repositioned new chat button into absolute positioned div within input
    area
  • Updated textarea padding to accommodate repositioned button (pl-24 on
    desktop)
  • Added mobile-specific padding logic for chat input field
  • Improved button styling with ghost variant and proper sizing
+18/-27 

Summary by CodeRabbit

  • New Features

    • Multi-thread chat manager with per-thread views, creation, switching, and thread-aware message flow and persistence.
    • Improved follow-up and inquiry handling with related-query suggestions.
  • Bug Fixes

    • Long-running AI workflows run in background with centralized error handling and resilient state saves.
  • UI/UX Improvements

    • New chat button placement, adjusted input padding, inline message spinner, and loading overlay test attribute.
  • Tests

    • Tests made robust to loading-overlay timing.

✏️ Tip: You can customize this high-level summary in your review settings.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants